home *** CD-ROM | disk | FTP | other *** search
- #include <iostream.h>
- #include "Date.h"
-
- main()
- {
- char buffer[1024];
-
- NDR_send ndr1(buffer,1024);
-
- Date birthday(12,25,65);
-
- char *test1="abcde";
-
- cout << "Birthday = " << birthday << endl;
- cout << "Encoding..." << endl;
-
- ndr1 << char('a') << short(32767) << int(32768) << (unsigned short)(65000)
- << "My birthday:" << birthday << " which is xmas";
-
- ndr1.insert(test1,5);
-
- cout << "Encoded NDR is : " << ndr1;
-
- NDR_receive ndr2(buffer,1024);
- Date bd;
- char m1[32];
- char m2[32];
- char test2[5];
- int count;
- char c;
- short s;
- unsigned short us;
- int i;
-
- cout << "Decoding..." << endl;
-
- ndr2 >> c >> s >> i >> us >> m1 >> bd >> m2;
-
- ndr2.extract(test2,count);
-
- cout << "c = " << c << endl;
- cout << "s = " << s << endl;
- cout << "i = " << i << endl;
- cout << "us = " << us << endl;
-
- cout << "m1 = " << m1 << endl;
-
- cout << "bd = " << bd << endl;
-
- cout << "m2 = " << m2 << endl;
- cout << "test2 = " << test2[0] << test2[1] << test2[2] << test2[3] << test2[4] << endl;
- cout << "count = " << count << endl;
-
- }
-